package org.bedracket.pgeg.datagen;

import com.google.common.collect.ImmutableList;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.*;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.ItemLike;
import org.bedracket.pgeg.init.ModBlocks;
import org.bedracket.pgeg.init.ModItems;
import org.bedracket.pgeg.util.Helpers;

import java.util.List;
import java.util.function.Consumer;

public class ModRecipeProvider extends RecipeProvider {

    public static final ImmutableList<ItemLike> AIR_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.AIR_INFUSED_STONE.get(),
                    ModBlocks.AIR_INFUSED_DEEPSLATE.get());
    public static final ImmutableList<ItemLike> AQUA_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.AQUA_INFUSED_STONE.get(),
                    ModBlocks.AQUA_INFUSED_DEEPSLATE.get());
    public static final ImmutableList<ItemLike> EARTH_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.EARTH_INFUSED_STONE.get(),
                    ModBlocks.EARTH_INFUSED_DEEPSLATE.get());
    public static final ImmutableList<ItemLike> ENTROPY_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.ENTROPY_INFUSED_STONE.get(),
                    ModBlocks.ENTROPY_INFUSED_DEEPSLATE.get());
    public static final ImmutableList<ItemLike> FIRE_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.FIRE_INFUSED_STONE.get(),
                    ModBlocks.FIRE_INFUSED_DEEPSLATE.get());
    public static final ImmutableList<ItemLike> ORDER_INFUSED_SMELTABLES =
            ImmutableList.of(ModBlocks.ORDER_INFUSED_STONE.get(),
                    ModBlocks.ORDER_INFUSED_DEEPSLATE.get());

    public static final ImmutableList<ItemLike> BRIMSTONE_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.BRIMSTONE_ORE.get(),
                    ModBlocks.DEEPSLATE_BRIMSTONE_ORE.get());
    public static final ImmutableList<ItemLike> METEORITE_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.METEORITE_ORE.get(),
                    ModBlocks.DEEPSLATE_METEORITE_ORE.get());
    public static final ImmutableList<ItemLike> MITHRIL_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.MITHRIL_ORE.get(),
                    ModBlocks.DEEPSLATE_MITHRIL_ORE.get());
    public static final ImmutableList<ItemLike> ORICHALCUM_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.ORICHALCUM_ORE.get(),
                    ModBlocks.DEEPSLATE_ORICHALCUM_ORE.get());
    public static final ImmutableList<ItemLike> SATURNIUM_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.SATURNIUM_ORE.get(),
                    ModBlocks.DEEPSLATE_SATURNIUM_ORE.get());
    public static final ImmutableList<ItemLike> SILVER_ORE_SMELTABLES =
            ImmutableList.of(ModBlocks.SILVER_ORE.get(),
                    ModBlocks.DEEPSLATE_SILVER_ORE.get());

    public ModRecipeProvider(PackOutput pOutput) {
        super(pOutput);
    }

    @Override
    protected void buildRecipes(Consumer<FinishedRecipe> pWriter) {
        ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, ModItems.DOUGH.get(), 8)
                .define('#', Items.WHEAT)
                .define('W', Items.WATER_BUCKET)
                .pattern("###")
                .pattern("#W#")
                .pattern("###")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.DOUGH.get());
        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BROWNIE.get())
                .requires(ModItems.DOUGH.get())
                .requires(Items.SUGAR)
                .requires(Items.COCOA_BEANS)
                .group("pgeg")
                .unlockedBy("has_dough", has(ModItems.DOUGH.get()))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BROWNIE.get());
        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.APPLE_PIE.get())
                .requires(Items.APPLE)
                .requires(Items.SUGAR)
                .requires(Items.EGG)
                .group("pies")
                .unlockedBy("has_apple", has(Items.APPLE))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.APPLE_PIE.get());
        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BERRY_JELLY.get(), 1)
                .requires(ModItems.BERRY.get())
                .requires(Items.SLIME_BALL)
                .requires(Items.SUGAR)
                .group("jelly")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BERRY_JELLY.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BERRY_PIE.get(), 1)
                .requires(ModItems.BERRY.get())
                .requires(Items.SUGAR)
                .requires(Items.EGG)
                .group("pies")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BERRY_PIE.get());
        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BURRITO_BEEF.get(), 1)
                .requires(Items.KELP)
                .requires(ModItems.DOUGH.get())
                .requires(ModItems.TOMATO.get())
                .requires(Items.COOKED_BEEF)
                .requires(ModItems.CHEESE.get())
                .group("burrito")
                .unlockedBy("has_kelp", has(Items.KELP))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BURRITO_BEEF.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BURRITO_FISH.get(), 1)
                .requires(Items.KELP)
               .requires(ModItems.DOUGH.get())
               .requires(ModItems.TOMATO.get())
               .requires(ItemTags.FISHES)
                .requires(ModItems.CHEESE.get())
                .group("burrito")
               .unlockedBy("has_kelp", has(Items.KELP))
                .save(pWriter,
                       Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                               + "/" + ModItems.BURRITO_FISH.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BURRITO_VEGGIE.get(), 1)
                .requires(Items.KELP)
                .requires(ModItems.DOUGH.get())
                .requires(ModItems.TOMATO.get())
                .requires(Items.CARROT)
                .requires(ModItems.CHEESE.get())
                .group("burrito")
                .unlockedBy("has_kelp", has(Items.KELP))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BURRITO_VEGGIE.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.CARAMEL_APPLE.get(), 1)
                .requires(Items.APPLE)
                .requires(Items.STICK)
                .requires(ModItems.CARAMEL.get())
                .group("pgeg")
                .unlockedBy("has_apple", has(Items.APPLE))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.CARAMEL_APPLE.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.CARAMEL_DONUT.get(), 1)
                .requires(ModItems.DOUGH.get())
                .requires(ModItems.CARAMEL.get())
                .group("pgeg")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.CARAMEL_DONUT.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.CHEESE_FRIES.get(), 1)
                .requires(Items.BAKED_POTATO)
                .requires(ModItems.CHEESE.get())
                .group("pgeg")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.CHEESE_FRIES.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.CHOCOLATE_PIE.get(), 1)
                .requires(Items.COCOA_BEANS)
                .requires(Items.SUGAR)
                .requires(Items.EGG)
                .group("pies")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.CHOCOLATE_PIE.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.NIGIRI_COD.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(Items.COD)
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.NIGIRI_COD.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.NIGIRI_SALMON.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(Items.SALMON)
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.NIGIRI_SALMON.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.NIGIRI_SQUID.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(ModItems.RAW_SQUID.get())
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.NIGIRI_SQUID.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.NIGIRI_TROPICAL.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(Items.TROPICAL_FISH)
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.NIGIRI_TROPICAL.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.ONIGIRI.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.ONIGIRI.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.ROLL_SEA_PICKLE.get(), 1)
                .requires(Items.DRIED_KELP)
                .requires(Items.SEA_PICKLE)
                .requires(ModItems.RICE.get())
                .group("sushi")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.ROLL_SEA_PICKLE.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.SLIME_PIE.get(), 1)
                .requires(Items.SLIME_BALL)
                .requires(Items.SUGAR)
                .requires(Items.EGG)
                .group("pies")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.SLIME_PIE.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.SUGAR_DONUT.get(), 1)
                .requires(ModItems.DOUGH.get())
                .requires(Items.SUGAR)
                .group("pgeg")
                .unlockedBy("has_sugar", has(Items.SUGAR))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.SUGAR_DONUT.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BACON.get())
                .requires(Items.PORKCHOP)
                .group("pgeg")
                .unlockedBy("has" + Items.PORKCHOP, has(Items.PORKCHOP))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BACON.get());

        ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ModItems.BERRY.get())
                .requires(Items.SWEET_BERRIES)
                .group("pgeg")
                .unlockedBy("has" + Items.SWEET_BERRIES, has(Items.SWEET_BERRIES))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.BERRY.get());
        SimpleCookingRecipeBuilder.smelting(Ingredient.of(Items.MILK_BUCKET), RecipeCategory.FOOD,
                ModItems.CHEESE.get(), 0.35F, 200)
                .group("pgeg")
                .unlockedBy("has" + Items.MILK_BUCKET, has(Items.MILK_BUCKET))
                .save(pWriter,
                        Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                                + "/" + ModItems.CHEESE.get());

        /*shaped crafting*/
        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_AXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern("XX")
                .pattern("XS")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_AXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_HOE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern("XX")
                .pattern(" S")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_HOE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_PICKAXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern("XXX")
                .pattern(" S ")
                .pattern(" S ")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_PICKAXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_SHEARS.get(), 1)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern(" X")
                .pattern("X ")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_SHEARS.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_SHOVEL.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern("X")
                .pattern("S")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_SHOVEL.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BRIMSTONE_SWORD.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.BRIMSTONE_INGOT.get())
                .pattern("X")
                .pattern("X")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_brimstone", has(ModItems.BRIMSTONE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.BRIMSTONE_SWORD.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, ModItems.COOKIE_CAT.get(), 16)
                .define('#', Items.WHEAT)
                .define('C', Items.COCOA_BEANS)
                .define('M', Items.MILK_BUCKET)
                .define('B', ModItems.BERRY.get())
                .pattern("#C#")
                .pattern("BMB")
                .pattern("#C#")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.COOKIE_CAT.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, ModItems.CREAM_COOKIE.get(), 16)
                .define('#', Items.WHEAT)
                .define('C', Items.COCOA_BEANS)
                .define('M', Items.MILK_BUCKET)
                .pattern("#C#")
                .pattern(" M ")
                .pattern("#C#")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.CREAM_COOKIE.get());
        
        ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, ModItems.LION_LICKER.get(), 1)
                .define('#', Items.SUGAR)
                .define('/', Items.STICK)
                .pattern(" #")
                .pattern("/ ")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.LION_LICKER.get());

//        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MANA_CAKE.get(), 4)
//                .define('#', Items.MILK_BUCKET)
//                .define('M', Items.MANA_CRYSTAL_DUST)
//                .define('E', Items.EGG)
//                .define('W', Items.WHEAT)
//                .pattern(" # ")
//                .pattern("MEM")
//                .pattern("WWW")
//                .group("pgeg")
//                .unlockedBy("has_wheat", has(Items.WHEAT))
//                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
//                        + "/" + ModItems.MANA_CAKE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_AXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern("XX")
                .pattern("XS")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_AXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_HOE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern("XX")
                .pattern(" S")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_HOE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_PICKAXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern("XXX")
                .pattern(" S ")
                .pattern(" S ")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_PICKAXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_SHEARS.get(), 1)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern(" X")
                .pattern("X ")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_SHEARS.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_SHOVEL.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern("X")
                .pattern("S")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_SHOVEL.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.METEORITE_SWORD.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.METEORITE_INGOT.get())
                .pattern("X")
                .pattern("X")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_meteorite_ingot", has(ModItems.METEORITE_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.METEORITE_SWORD.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MITHRIL_AXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern("XX")
                .pattern("XS")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_mithril_ingot", has(ModItems.MITHRIL_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.MITHRIL_AXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MITHRIL_HOE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern("XX")
                .pattern(" S")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_mithril_ingot", has(ModItems.MITHRIL_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.MITHRIL_HOE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MITHRIL_PICKAXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern("XXX")
                .pattern(" S ")
                .pattern(" S ")
                .group("pgeg")
                .unlockedBy("has_mithril_ingot", has(ModItems.MITHRIL_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.MITHRIL_PICKAXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MITHRIL_SHEARS.get(), 1)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern(" X")
                .pattern("X ")
                .group("pgeg")
                .unlockedBy("has_mithril_ingot", has(ModItems.MITHRIL_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.MITHRIL_SHEARS.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.MITHRIL_SHOVEL.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern("X")
                .pattern("S")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_mithril_ingot", has(ModItems.MITHRIL_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.MITHRIL_SHOVEL.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, ModItems.MITHRIL_SWORD.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.MITHRIL_INGOT.get())
                .pattern("X")
                .pattern("X")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.MITHRIL_SWORD.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_AXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern("XX")
                .pattern("XS")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_AXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_HOE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern("XX")
                .pattern(" S")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_HOE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_PICKAXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern("XXX")
                .pattern(" S ")
                .pattern(" S ")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_PICKAXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_SHEARS.get(), 1)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern(" X")
                .pattern("X ")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_SHEARS.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_SHOVEL.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern("X")
                .pattern("S")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_SHOVEL.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.ORICHALCUM_SWORD.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.ORICHALCUM_INGOT.get())
                .pattern("X")
                .pattern("X")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_orichalcum_ingot", has(ModItems.ORICHALCUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.ORICHALCUM_SWORD.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_AXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern("XX")
                .pattern("XS")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_AXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_HOE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern("XX")
                .pattern(" S")
                .pattern(" S")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_HOE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_PICKAXE.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern("XXX")
                .pattern(" S ")
                .pattern(" S ")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_PICKAXE.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_SHEARS.get(), 1)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern(" X")
                .pattern("X ")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_SHEARS.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_SHOVEL.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern("X")
                .pattern("S")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_SHOVEL.get());

        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.SATURNIUM_SWORD.get(), 1)
                .define('S', Items.STICK)
                .define('X', ModItems.SATURNIUM_INGOT.get())
                .pattern("X")
                .pattern("X")
                .pattern("S")
                .group("pgeg")
                .unlockedBy("has_saturnium_ingot", has(ModItems.SATURNIUM_INGOT.get()))
                .save(pWriter, Helpers.identifier(RecipeCategory.TOOLS.getFolderName())
                        + "/" + ModItems.SATURNIUM_SWORD.get());
        /**
        ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.WAND.get(), 1)
                .define('S', Items.STICK)
                .define('M', Items.MANA_CRYSTAL_DUST)
                .pattern(" MS")
                .pattern(" SM")
                .pattern("S  ")
                .group("pgeg")
                .unlockedBy("has_wheat", has(Items.WHEAT))
                .save(pWriter, Helpers.identifier(RecipeCategory.FOOD.getFolderName())
                        + "/" + ModItems.WAND.get());*/
        heatRecipe(pWriter, ModItems.RAW_SQUID.get(), ModItems.COOKED_SQUID.get());
        heatRecipe(pWriter, Items.SUGAR, ModItems.CARAMEL.get());
        oreRecipe(pWriter, AIR_INFUSED_SMELTABLES, ModItems.AIR_SHARD.get());
        oreRecipe(pWriter, AQUA_INFUSED_SMELTABLES, ModItems.AQUA_SHARD.get());
        oreRecipe(pWriter, EARTH_INFUSED_SMELTABLES, ModItems.EARTH_SHARD.get());
        oreRecipe(pWriter, ENTROPY_INFUSED_SMELTABLES, ModItems.ENTROPY_SHARD.get());
        oreRecipe(pWriter, FIRE_INFUSED_SMELTABLES, ModItems.FIRE_SHARD.get());
        oreRecipe(pWriter, ORDER_INFUSED_SMELTABLES, ModItems.ORDER_SHARD.get());

        oreRecipe(pWriter, BRIMSTONE_ORE_SMELTABLES, ModItems.BRIMSTONE_INGOT.get());
        oreRecipe(pWriter, METEORITE_ORE_SMELTABLES, ModItems.METEORITE_INGOT.get());
        oreRecipe(pWriter, MITHRIL_ORE_SMELTABLES, ModItems.MITHRIL_INGOT.get());
        oreRecipe(pWriter, ORICHALCUM_ORE_SMELTABLES, ModItems.ORICHALCUM_INGOT.get());
        oreRecipe(pWriter, SATURNIUM_ORE_SMELTABLES, ModItems.SATURNIUM_INGOT.get());
        oreRecipe(pWriter, SILVER_ORE_SMELTABLES, ModItems.SILVER_INGOT.get());
    }

    protected void oreRecipe(Consumer<FinishedRecipe> pWriter, List<ItemLike> pIngredients, ItemLike item) {
        oreSmelting(pWriter, pIngredients,
                RecipeCategory.MISC, item,
                0.7F, 200, "pgeg");
        oreBlasting(pWriter, pIngredients,
                RecipeCategory.MISC, item,
                0.7F, 100, "pgeg");
    }

    protected void heatRecipe(Consumer<FinishedRecipe> pWriter, ItemLike ingredient, ItemLike result) {
        SimpleCookingRecipeBuilder.smelting
                        (Ingredient.of(ingredient),
                                RecipeCategory.FOOD,
                                result,
                                0.35F, 200)
                .unlockedBy(getHasName(ingredient), has(ingredient))
                .save(pWriter,Helpers.identifier("heat/"  + getItemName(result) + "_from_" + "smelting"));
        SimpleCookingRecipeBuilder.smoking(Ingredient.of(ingredient),
                        RecipeCategory.FOOD, result,
                        0.35F, 200)
                .unlockedBy(getHasName(ingredient), has(ingredient))
                .save(pWriter,Helpers.identifier("heat/"  + getItemName(result) + "_from_" + "smoking"));
        SimpleCookingRecipeBuilder.campfireCooking(Ingredient.of(ingredient),
                        RecipeCategory.FOOD, result,
                        0.35F, 200)
                .unlockedBy(getHasName(ingredient), has(ingredient))
                .save(pWriter,Helpers.identifier("heat/"  + getItemName(result) + "_from_" + "campfire"));
    }

    protected static void oreSmelting(Consumer<FinishedRecipe> pFinishedRecipeConsumer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTIme, String pGroup) {
        oreCooking(pFinishedRecipeConsumer, RecipeSerializer.SMELTING_RECIPE, pIngredients, pCategory, pResult, pExperience, pCookingTIme, pGroup, "_from_smelting");
    }

    protected static void oreBlasting(Consumer<FinishedRecipe> pFinishedRecipeConsumer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup) {
        oreCooking(pFinishedRecipeConsumer, RecipeSerializer.BLASTING_RECIPE, pIngredients, pCategory, pResult, pExperience, pCookingTime, pGroup, "_from_blasting");
    }

    protected static void oreCooking(Consumer<FinishedRecipe> pFinishedRecipeConsumer, RecipeSerializer<? extends AbstractCookingRecipe> pCookingSerializer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) {
        for(ItemLike itemlike : pIngredients) {
            SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer).group(pGroup)
                    .unlockedBy(getHasName(itemlike), has(itemlike)).save(pFinishedRecipeConsumer,
                            Helpers.identifier(pCategory.getFolderName() + "/" +
                                    getItemName(pResult) + pRecipeName + "_" + getItemName(itemlike)));
        }

    }
}
